package com.zxy.zxyrpc.config;

import com.zxy.zxyrpc.fault.tolerant.TolerantStrategyKeys;
import com.zxy.zxyrpc.loadBalancer.LoadBalancerKeys;
import com.zxy.zxyrpc.retry.RetryStrategyKeys;
import com.zxy.zxyrpc.serializer.SerializerKeys;
import com.zxy.zxyrpc.server.VertxKeys;
import lombok.Data;

/**
 * RPC框架配置
 *
 * @author zxy
 * @since 2025/5/11
 **/
@Data
public class RpcConfig {
    /**
     * rpc 服务名称
     */
    private String name = "zxy-rpc";
    /**
     * 服务版本号
     */
    private String version = "1.0";
    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";
    /**
     * 服务器端口号
     */
    private Integer serverPort = 8082;

    /**
     * 是否开启mock服务
     */
    private boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;

    /**
     * 注册器配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();
    /**
     * 请求负载均衡配置
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;
    /**
     * 重试机制配置
     */
    private String retryStrategy = RetryStrategyKeys.NO;
    /**
     * 容错机制配置
     * */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FIST;
    /**
     * 协议类型
     * */
    private String VertxServer = VertxKeys.HTTP;
}
